var anwajax = {
	load:function(url, id_class)
	{
		//load menu chinh
		$("#iconload").css('display','block');
		$(id_class).load(url);
		$("#iconload").css('display','none');
	},
	
	category:function(links, id, li)
	{
		// load cac the loai nhac
		$("#iconload").css('display','block');
		var url = site + links ;
		$('#'+id).load(url);
		$("#iconload").css('display','none');
		
		// set selected
		$(".category ul li").removeClass('selected') ;
		$("#"+li).addClass("selected") ;
	},
	
	banner:function(links, id)
	{
		var url = site + links ;
		$('#'+id).load(url);
	},
	
	detail_events:function(links, id)
	{
		var url = site + links ;
		$.post(links,{id:id},function(data)
		{
			$('.detail_events').prepend(data);
		},'html');
	}
}

/**
 * @method convert link
 * 
 * @param objTagA
 * @param div
 * @return
 */
function convertLinkCodeAjax(objTagA, div) {
	var url = objTagA.href;
	objTagA.href = "javascript:void(0)";
	var browser = navigator.appName;
	
	if (browser == "Microsoft Internet Explorer") {
		objTagA.onclick = function() {
			$('#' + div).load(url + "/" );
		};
	} else
		objTagA.setAttribute("onclick", "$('#" + div + "').load('" + url + "/');");

}

function processPageBarCodeAjax(divPageBar, divAjax) 
{
	var common_page_bar = document.getElementById(divPageBar);
	var tagAs = common_page_bar.getElementsByTagName("A");
	if (tagAs) {
		for ( var i = 0; i < tagAs.length; i++) {
			convertLinkCodeAjax(tagAs[i], divAjax);
		}
	}
}

function set_wave_music(catid)
{
	$('div.catmusic div').html('') ; 
	$('#catid' + catid).html('<img src="'+ site +'templates/images/songnhac.gif" height="25px">');
}

function trit(a)
{
	console.log(a) ;
}